﻿#include "showui.h"

showui::showui()
{

}

showui::showui(QWidget *parent):QWidget(parent){
    setFixedSize(1100, 980);
}

void showui::paintEvent(QPaintEvent *event){
    Q_UNUSED(event);
    if(select_view==0){
        QPixmap pixmap(":/new/prefix1/p/view.jpg");
        QPainter painter(this);
        painter.drawPixmap(rect(), pixmap);
        QPushButton *bottom1=new QPushButton("单人游戏",this);
        QFont font;
        font.setPointSize(30);
        bottom1->setFont(font);
        bottom1->setGeometry(100,800,250,70);
        bottom1->show();
        QPushButton *bottom2=new QPushButton("多人游戏",this);
        bottom2->setFont(font);
        bottom2->setGeometry(400,800,250,70);
        bottom2->show();
        QPushButton *bottom3=new QPushButton("设置",this);
        bottom3->setFont(font);
        bottom3->setGeometry(700,800,250,70);
        bottom3->show();
        connect(bottom1,&QPushButton::clicked,this,[](){
            select_view=2;
        });
        connect(bottom2,&QPushButton::clicked,this,[](){
           select_view=1;
        });
        connect(bottom3,&QPushButton::clicked,this,[](){
           select_view=3;
        });
    }

}


